public class Solution2 {
    public int maxArea(int[] height) {
        int left =0;
        int right = height.length-1;
        int V = 0;
        int ret = 0;
        while(left<right) {
            V = Math.min(height[left],height[right])*(right-left);
            ret = Math.max(ret,V);
            //谁小谁移动
            if(height[left]<height[right]) left++;
            else right--;
        }
        return ret;
    }
}
